<template>
  <div class="app">
    <div class="swipe">
      <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white" :height="100">
        <van-swipe-item  v-for="(item,index) in bannerList" :key="index" >
          <img :src="item.bannerUrl" alt="">
        </van-swipe-item>
      </van-swipe>
    </div>
  </div>
</template>

<script>
import {banner_list} from '../utils/api'
export default {
  data(){
    return{
      bannerList:[]
    }
  },
  mounted(){
    banner_list().then((res)=>{
      this.bannerList=res.data.list
      console.log(this.bannerList[0].bannerUrl)
    })
  }
}
</script>

<style lang="scss" scoped>
.my-swipe .van-swipe-item {
    color: #fff;
    font-size: 20px;
    line-height: 150px;
    text-align: center;
    background-color: #39a9ed;
  }
.swipe{
  padding: 15px 10px;
  box-sizing: border-box;
  .my-swipe{
    border-radius: 8px;
    img{
      width: 100%;
      height: 100%;
    }
  }
}
</style>